//
//  YYYComposeButton.swift
//  HotNews
//
//  Created by YYY on 2017/11/2.
//  Copyright © 2017年 成品家（北京）网路科技有限公司. All rights reserved.
//

import UIKit

class YYYComposeButton: UIControl {

    
    //图片
    private lazy var imageView = UIImageView(image: UIImage(named: "tabbar_compose_friend"))

    //文字
    private lazy var titleLabel = UILabel(text: "", fontSize: 14, color: UIColor.darkGray)
    
    //跳转控制器的名称
    var clsName: String?
    
    //重载构造函数
    init(imageStr: String, titleStr: String)
    {
        super.init(frame: CGRect())
        frame = CGRect(x: 0, y: 0, width: 100, height: 100)
        addSubview(imageView)
        addSubview(titleLabel)
        
        imageView.image = UIImage(named: imageStr)
        imageView.center.x = center.x
        
        titleLabel.frame = CGRect(x: 0, y: imageView.bottom + 5, width: width, height: 20)
        titleLabel.text = titleStr
        titleLabel.textAlignment = .center
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
